﻿using System.Data;
using Project.IBIZ;
using Project.DTO;
using Project.IDAO;
using Project.DAO;

namespace Project.BIZ
{
    /// <summary>
    /// Class define business method(s) for logging in the system
    /// </summary>
    public class LoginBIZ : ILoginBIZ
    {
        /// <summary>
        /// Global instance of LoginDAO
        /// </summary>
        ILoginDAO LoginDao = new LoginDAO();

        /// <summary>
        /// Check for a valid user
        /// </summary>
        /// <param name="userInfo">User object</param>
        /// <returns>0: Incorrect info. 1:Valid user. 2:Inactive account</returns>
        public int IsValidUser(User userInfo)
        {
            return LoginDao.IsValidUser(userInfo);
        }
    }
}
